package JMU3.BianChen.ti4;

import java.util.Random;
import java.util.Scanner;

/**
 * @author Lenovo
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
       long seed= scanner.nextLong();
       int n= scanner.nextInt();
       Random random=new Random(seed);
       int count=0;
       for(int i=0;i<n;i++){
           double x= random.nextDouble()*2-1;
           double y= random.nextDouble()*2-1;
           if(Math.sqrt(Math.pow(x,2)+Math.pow(y,2))<1){
               count++;
           }
       }
       double PI=4.0*count/n;
        System.out.println(PI);
    }
}
